package com.rt.system.mapper;

import java.util.List;
import java.util.Map;

import com.rt.system.domain.RtQuestionsInfo;
import org.apache.ibatis.annotations.Param;

/**
 * 试题Mapper接口
 * 
 * @author Yg
 * @date 2022-04-13
 */
public interface RtQuestionsInfoMapper 
{
    /**
     * 查询试题
     * 
     * @param id 试题主键
     * @return 试题
     */
    public RtQuestionsInfo selectRtQuestionsInfoById(String id);

    /**
     * 根据pid查询试题
     *
     * @param pid 试题主键
     * @return 试题
     */
    public List<RtQuestionsInfo> selectRtQuestionsInfoByPId(String pid);

    /**
     * 查询试题列表
     * 
     * @param rtQuestionsInfo 试题
     * @return 试题集合
     */
    public List<RtQuestionsInfo> selectRtQuestionsInfoList(RtQuestionsInfo rtQuestionsInfo);

    /**
     * 新增试题
     * 
     * @param rtQuestionsInfo 试题
     * @return 结果
     */
    public int insertRtQuestionsInfo(RtQuestionsInfo rtQuestionsInfo);

    /**
     * 修改试题
     * 
     * @param rtQuestionsInfo 试题
     * @return 结果
     */
    public int updateRtQuestionsInfo(RtQuestionsInfo rtQuestionsInfo);

    /**
     * 删除试题
     * 
     * @param id 试题主键
     * @return 结果
     */
    public int deleteRtQuestionsInfoById(String id);

    /**
     * 批量删除试题
     * 
     * @param ids 需要删除的数据主键集合
     * @return 结果
     */
    public int deleteRtQuestionsInfoByIds(String[] ids);

    // 根据pid删除
    public int deleteRtQuestionsInfoByPId(String id);

    // 查询出试题难度
    RtQuestionsInfo selectRtQuestionsInfoErrorById(String questionId);

    // 新增试题图片
    public int insertRtQuestionsPhoto(Map<String, Object> map);

    // 根据试题删除原有图片
    public int deleteRtQuestionsPhotoQId(String id);

    // 查询试题统计列表
    List<RtQuestionsInfo> selectRtQuestionsInfoCountList(RtQuestionsInfo rtQuestionsInfo);

    // 查询试题可用
    List<RtQuestionsInfo> selectRtExamQuestionsInfoList(@Param("subjectId")Long subjectId,@Param("belongArea")Long belongArea);

    // 根据科目查询id
    Long selectSubjectByName(String name);

    // 查询类型id
    Long selectQuestionTypeByName(String cut);

    // 查询大纲id
    Long selectKnowledgeByName(@Param("cut") String cut,@Param("subjectId")Long subjectId);

    // 查询错误率id
    Integer selectDifficultyByName(String cut);

    // 查询重要度id
    Long selectImportanceByCode(String cut);

    // 查询命题人id
    String selectExpertName(String cut);
}
